// ----------------------------------
// RSDK Project: Sonic 1/Sonic 2
// Script Description: Waterfall Sound Object
// Script Author: Christan Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 72 : TYPE_WATERFALLSOUND


// Static Values

// Tables

event ObjectMain
	object.priority = PRIORITY_ACTIVE
	GHZSetup_value30 = 1
	temp0 = screen.cameraX
	temp0 -= object.ixpos
	Abs(temp0)
	temp0 -= 128
	if temp0 > screen.xcenter
		object.priority = PRIORITY_XBOUNDS
		object.value0 = 0
		object.value1 = 0
	end if
	GHZSetup_value31 = object.xpos
	GHZSetup_value31 -= object[0].xpos
	GHZSetup_value31 >>= 18
end event


event ObjectStartup
	foreach (TypeName[Waterfall Sound], arrayPos0, ALL_ENTITIES)
		object[arrayPos0].priority = PRIORITY_XBOUNDS
	next
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
